home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / gemfut15.lzh / AESUTRC4.C < prev    next >
C/C++ Source or Header  |  1989-08-26  |  1KB  |  43 lines

  1.  
  2. /**************************************************************************
  3.  *
  4.  * AESFAST PD utilties.
  5.  *
  6.  *  Rectangle utilities 4...
  7.  *    rc_gtov
  8.  *    rc_vtog
  9.  *************************************************************************/
  10.  
  11. #include <gemfast.h>
  12.  
  13. /*-------------------------------------------------------------------------
  14.  * rc_gtov - Convert GRECT to VRECT.
  15.  *-----------------------------------------------------------------------*/
  16.  
  17. void
  18. rc_gtov(pgrect, pvrect)
  19.     register GRECT *pgrect;
  20.     register VRECT *pvrect;
  21. {
  22.     pvrect->v_x1 = pgrect->g_x;
  23.     pvrect->v_y1 = pgrect->g_y;
  24.     pvrect->v_x2 = pgrect->g_x + pgrect->g_w;
  25.     pvrect->v_y2 = pgrect->g_y + pgrect->g_h;    
  26. }
  27.  
  28. /*-------------------------------------------------------------------------
  29.  * rc_vtog - Convert VRECT to GRECT.
  30.  *-----------------------------------------------------------------------*/
  31.  
  32. void
  33. rc_vtog(pvrect, pgrect)
  34.     register VRECT *pvrect;
  35.     register GRECT *pgrect;
  36. {
  37.     pgrect->g_x = pvrect->v_x1;
  38.     pgrect->g_y = pvrect->v_y1;
  39.     pgrect->g_w = pvrect->v_x2 - pvrect->v_x1;
  40.     pgrect->g_h = pvrect->v_y2 - pvrect->v_y1;
  41. }
  42.  
  43.